#include "OWindow.h"

O_START_NAMESPACE
/*
//I prefer to be able to access my variables directly.
	Ogre::Root* lRoot = lOgreInit.mRoot.get();
	Ogre::RenderWindow* lWindow = lOgreInit.mWindow;

	// Here I create the necessary objects of OIS to manage Keyboard and Mouse.
	OIS::InputManager* lInputManager = NULL;
	OIS::Mouse* lMouse = NULL;
	OIS::Keyboard* lKeyboard = NULL;
	{
		// The input/output system needs an handle to a window as input, in a string format.
		// 1/ we need to get the "windows-API" handle
		size_t windowHandle = 0;
		lWindow->getCustomAttribute("WINDOW", &windowHandle);

		// 2/ convert it into a string
		std::string windowsHandleAsString="";
		{
			std::ostringstream windowHndStr;
			windowHndStr << windowHandle;
			windowsHandleAsString = windowHndStr.str();
		}

		// 3/ we translate it into a format accepted by OIS (the input library).
		OIS::ParamList lSpecialParameters;
		lSpecialParameters.insert(std::make_pair(std::string("WINDOW"), windowsHandleAsString));

		// 4/ we create the input/output system itself.
		lInputManager = OIS::InputManager::createInputSystem( lSpecialParameters );

		// the events can be stored or not in a buffer
		bool lBufferedKeys = false;
		bool lBufferedMouse = false;

		// creation of the keyboard-representing object
		lKeyboard = static_cast<OIS::Keyboard*>(lInputManager->createInputObject(OIS::OISKeyboard, lBufferedKeys));

		// creation of the mouse-representing object
		lMouse = static_cast<OIS::Mouse*>(lInputManager->createInputObject( OIS::OISMouse, lBufferedMouse));

		// then must tell the mouse how much it is allowed to move.
		const OIS::MouseState &infoSouris = lMouse->getMouseState();
		infoSouris.width = lWindow->getWidth();
		infoSouris.height = lWindow->getHeight();
	}
*/
O_END_NAMESPACE
